<template>
  <div>
    <h1>{{ msg }}</h1>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "Hello, 70",
    };
  },
  beforeMount() {
    console.log(document.querySelector("h1"), "beforeMount,获取h1标签");
    console.log("beforeMount被触发了");
  },
  //在挂载阶段的mounted方法中,可以获取真实的DOM元素
  mounted() {
    console.log(document.querySelector("h1"), "mounted,获取h1标签");
    console.log("mounted被触发了");
  },
};
</script>

<style>
</style>